package com.funcourse.demo.business;

import com.funcourse.demo.api.restful.io.response.error.BusinessError;
import com.funcourse.demo.api.restful.io.response.error.CustomizedError;

public enum RoomServiceError implements BusinessError {

  ROOM_STATUS_WRONG(1001,"房间状态不满足"),
  ROOM_NOT_FOUND(1002,"房间未找到"),;

  private Integer errorCode;
  private String errorMsg;

  RoomServiceError(Integer errorCode,String errorMsg){
    this.errorCode = errorCode;
    this.errorMsg = errorMsg;
  }

  public CustomizedError customizedError(String desc){
    return new CustomizedError(this.errorCode,desc);
  }

  @Override
  public Integer getErrorCode() {
    return errorCode;
  }

  @Override
  public String getErrorMessage() {
    return errorMsg;
  }
}
